#ifndef ENV_H
#define ENV_H

#include "OpenGL/shader.h"
#include "OpenGL/renderer.h"
#include "Operation/operationlist.h"

class GeoMap;

namespace Env
{

    /* Shaders */
    extern Shader pointShader;
    extern Shader lineShader;
    extern Shader polygonShader;
    extern Shader borderShader;
    extern Shader highlightShader;
    extern Shader textureShader;
    extern Renderer renderer;
    void createShaders();

    /* Mouse Cursor */
    enum class CursorType
    {
        Normal = 0,
        Palm = 1,
        Editing = 2,
        WhatIsThis = 3,
        Cross = 4,
    };
    //======================================
    enum class DrawType
    {
        point=0,
        line=1,
        polygon=2,
        none=3,
    };

    //Mouse draw type
    extern DrawType drawType;
    //======================================
    // Whether is editing map
    extern bool isEditing;

    // Mouse cursor type
    // Normal, palm, etc.
    extern CursorType cursorType;

    // map
    // There is only one map in one project
    extern GeoMap* map;

    // curEditingLayer
    // There is only one layer is edited in one project
    extern GeoFeatureLayer* curEditingLayer;

    extern QString curLayerName;

    extern QString curDatabase;

    // Project home path
    extern QString HOME;

    // Record the operations: move features, delete features, etc.
    extern OperationList opList;

} // namespace Env

#endif // ENV_H
